#include "arduinomega/WProgram.h"
#include "arduinomega/Wire/Wire.h"
#include "arduinomega/SoftwareSerial/SoftwareSerial.h"
#include <math.h>

extern "C" void __cxa_pure_virtual(){}

void setup();
void loop();
const int IR = 3;
int IR_volts;

int main()
{
	// The init() function is defined in the Arduino library.
	// It initialises the timers and the ADC on the ATmega1280.
	init();
	setup();

	while( true )
	{
		loop();
	}

	return 0;
}

void setup()
{
	/*writes S to serial for start
	 * then lets default script run for 2 seconds
	 * then sets led to red
	 * then delays two seconds
	 * then returns
	 */

	Serial.begin( 38400 );//set baud rate ... must be set in RealTerm as well
	Serial.println( "Start IR Sensor testing" );//write S to serial out for start



	//Serial.println( "End IR Sensor testing: " );
			//print E for end to serial out
}
void loop()
{
	 IR_volts = analogRead(IR);
	 //float distance = 65*pow(IR_volts, -1.10);
	 //analogValue1 = analogValue1 / 4;
     Serial.print(" IR Reading: ");
     Serial.println(IR_volts, DEC);



	delay( 1000 );
}
